<template>
<van-tabbar route active-color="#1baeae">
  <van-tabbar-item replace to="/home" icon="home-o">首页</van-tabbar-item>
  <van-tabbar-item replace to="/article" icon="records">文章</van-tabbar-item>
  <van-tabbar-item replace to="/cart" icon="shopping-cart-o" :badge="cartStore.num?cartStore.num:''">购物车</van-tabbar-item>
  <van-tabbar-item replace to="/user" icon="contact">我的</van-tabbar-item>
</van-tabbar>
</template>

<script setup>
    import useCartStore from '@/store/useCartStore'
    import {getToken} from '../utils/token'
     let cartStore = useCartStore()
    if(getToken()){
      cartStore.getCartInfo()
    }
  
</script>

<style scoped>
 :deep() .van-tabbar-item .van-badge{
        background-color: #1baeae;
    }
</style>